<template>
  <div>
    <h4><span style="color:#fc8e2d">{{ getTitle }}</span></h4>
    <el-form class="queryForm" label-width="100px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="来源部门：">
            {{ct.fromDeptName}}
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="来源人：">
            {{ct.fromUserName}}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="接收部门：">
            {{ct.toDeptName}}
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="接收人：">
            {{ct.toUserName}}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="联系电话：">
            {{ct.toUserMobile}}
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item v-if="ct.type === 11" label="借入时间：">
            {{ct.transactionTime.substring(0,10)}}
          </el-form-item>
          <el-form-item v-else-if="ct.type === 12" label="归还时间：">
            {{ct.transactionTime.substring(0,10)}}
          </el-form-item>
          <el-form-item v-else-if="ct.type === 21" label="借出时间：">
            {{ct.transactionTime.substring(0,10)}}
          </el-form-item>
          <el-form-item v-else-if="ct.type === 22" label="收回时间：">
            {{ct.transactionTime.substring(0,10)}}
          </el-form-item>
          <el-form-item v-else-if="ct.type === 3" label="流转时间：">
            {{ct.transactionTime.substring(0,10)}}
          </el-form-item>
          <el-form-item v-else-if="ct.type === 30" label="流回时间：">
            {{ct.transactionTime.substring(0,10)}}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="备注：">
            {{ct.remark? ct.remark:'无'}}
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>
  export default {
    props: {
      ct: {
        type: Object
      },
    },
    computed: {
      getTitle(){
        let label = ""
        if(this.ct.type === 11){
          label = "借入"
        } else if(this.ct.type === 12){
          label = "归还"
        } else if(this.ct.type === 21){
          label = "借出"
        } else if(this.ct.type === 22){
          label = "收回"
        } else if(this.ct.type === 3){
          label = "流转"
        } else if(this.ct.type === 30){
          label = "流回"
        }
        return label
      }
    },
    methods: {
      
    }
  }
</script>

<style lang="scss">
  .queryForm .el-form-item{
      margin-bottom: 0px;
    }
</style>